package com.jack.thinking.java._22.swing.swt;

import java.io.PrintWriter;
import java.io.StringWriter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

import com.utils.SWTConsole;

public class DisplayEnvironment implements SWTApplication{

	@Override
	public void createContents(Composite parent) {
		parent.setLayout(new FillLayout());
		Text text = new Text(parent, SWT.WRAP | SWT.V_SCROLL);
		StringWriter props = new StringWriter();
		System.getProperties().list(new PrintWriter(props));
		text.setText(props.toString());
	}

	public static void main(String[] args) {
		SWTConsole.run(new DisplayEnvironment(), 800, 600);
	}
}
